#include "process.h"

void download(callback_t cb)
{
	srand(time(NULL) ^ 1023);
	int total = FILESIZE;
	while (total)
	{
		Sleep(100);
		int one = rand() % (1024 * 1024) * 200;
		total -= one;
		if (total < 0)
		{
			total = 0;
		}
		int download = FILESIZE - total;
		double rate = (download * 1.0 / (FILESIZE)) * 100;
		cb(rate);
	}
}

int main()
{
	download(Process_flush);
	return 0;
}